public class Fibonacci {
    public int Fibonacci(int n) {
        int[] res = {0,1};
        if(n<=1){
            return res[n];
        }
        int Fib = 0;
        int one = 0;
        int two = 1;
        for(int i=2;i<=n;i++){
            Fib = one+two;
            one = two;
            two = Fib;
        }
        return Fib;
    }
}
